﻿//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define LOG(format, ...) printf(">> " format "\n", ##__VA_ARGS__)
//C++ TO C# CONVERTER CRACKED BY X-CRACKER 2017 NOTE: The following #define macro was replaced in-line:
//ORIGINAL LINE: #define NULL (void*)0



// 需要平台实现的函数
public class DSM_REQUIRE_FUNCS
{
	public delegate void testDelegate();
	public testDelegate test;
	public delegate void logDelegate(ref string msg); // msg末尾不带\n
	public logDelegate log;
	public delegate void exitDelegate();
	public exitDelegate exit;
	public delegate void srandDelegate(uint seed);
	public srandDelegate srand;
	public delegate int randDelegate();
	public randDelegate rand;
	public delegate int mem_getDelegate(string[] mem_base, ref uint mem_len);
	public mem_getDelegate mem_get;
	public delegate int mem_freeDelegate(ref string mem, uint mem_len);
	public mem_freeDelegate mem_free;
	public delegate int timerStartDelegate(ushort t);
	public timerStartDelegate timerStart;
	public delegate int timerStopDelegate();
	public timerStopDelegate timerStop;
	public delegate uint get_uptime_msDelegate();
	public get_uptime_msDelegate get_uptime_ms;
	public delegate int getDatetimeDelegate(mr_datetime datetime);
	public getDatetimeDelegate getDatetime;
	public delegate int sleepDelegate(uint ms);
	public sleepDelegate sleep;
	public delegate int openDelegate(string filename, uint mode);
	public openDelegate open;
	public delegate int closeDelegate(int f);
	public closeDelegate close;
	public delegate int readDelegate(int f, object p, uint l);
	public readDelegate read;
	public delegate int writeDelegate(int f, object p, uint l);
	public writeDelegate write;
	public delegate int seekDelegate(int f, int pos, int method);
	public seekDelegate seek;
	public delegate int infoDelegate(string filename);
	public infoDelegate info;
	public delegate int removeDelegate(string filename);
	public removeDelegate remove;
	public delegate int renameDelegate(string oldname, string newname);
	public renameDelegate rename;
	public delegate int mkDirDelegate(string path);
	public mkDirDelegate mkDir;
	public delegate int rmDirDelegate(string path);
	public rmDirDelegate rmDir;
	public delegate int opendirDelegate(string name);
	public opendirDelegate opendir;
	public delegate string readdirDelegate(int f);
	public readdirDelegate readdir;
	public delegate int closedirDelegate(int f);
	public closedirDelegate closedir;
	public delegate int getLenDelegate(string filename);
	public getLenDelegate getLen;
	public delegate void drawBitmapDelegate(ref ushort bmp, short x, short y, ushort w, ushort h);
	public drawBitmapDelegate drawBitmap;
	public delegate int mr_initNetworkDelegate(MR_INIT_NETWORK_CB cb, string mode);
	public mr_initNetworkDelegate mr_initNetwork;
	public delegate int mr_closeNetworkDelegate();
	public mr_closeNetworkDelegate mr_closeNetwork;
	public delegate int mr_getHostByNameDelegate(string ptr, MR_GET_HOST_CB cb);
	public mr_getHostByNameDelegate mr_getHostByName;
	public delegate int mr_socketDelegate(int type, int protocol);
	public mr_socketDelegate mr_socket;
	public delegate int mr_connectDelegate(int s, int ip, ushort port, int type);
	public mr_connectDelegate mr_connect;
	public delegate int mr_getSocketStateDelegate(int s);
	public mr_getSocketStateDelegate mr_getSocketState;
	public delegate int mr_closeSocketDelegate(int s);
	public mr_closeSocketDelegate mr_closeSocket;
	public delegate int mr_recvDelegate(int s, ref string buf, int len);
	public mr_recvDelegate mr_recv;
	public delegate int mr_sendDelegate(int s, string buf, int len);
	public mr_sendDelegate mr_send;
	public delegate int mr_recvfromDelegate(int s, ref string buf, int len, ref int ip, ref ushort port);
	public mr_recvfromDelegate mr_recvfrom;
	public delegate int mr_sendtoDelegate(int s, string buf, int len, int ip, ushort port);
	public mr_sendtoDelegate mr_sendto;
	public delegate int mr_startShakeDelegate(int ms);
	public mr_startShakeDelegate mr_startShake;
	public delegate int mr_stopShakeDelegate();
	public mr_stopShakeDelegate mr_stopShake;
	public delegate int mr_playSoundDelegate(int type, object data, uint dataLen, int loop);
	public mr_playSoundDelegate mr_playSound;
	public delegate int mr_stopSoundDelegate(int type);
	public mr_stopSoundDelegate mr_stopSound;
	public delegate int mr_dialogCreateDelegate(string title, string text, int type);
	public mr_dialogCreateDelegate mr_dialogCreate;
	public delegate int mr_dialogReleaseDelegate(int dialog);
	public mr_dialogReleaseDelegate mr_dialogRelease;
	public delegate int mr_dialogRefreshDelegate(int dialog, string title, string text, int type);
	public mr_dialogRefreshDelegate mr_dialogRefresh;
	public delegate int mr_textCreateDelegate(string title, string text, int type);
	public mr_textCreateDelegate mr_textCreate;
	public delegate int mr_textReleaseDelegate(int text);
	public mr_textReleaseDelegate mr_textRelease;
	public delegate int mr_textRefreshDelegate(int handle, string title, string text);
	public mr_textRefreshDelegate mr_textRefresh;
	public delegate int mr_editCreateDelegate(string title, string text, int type, int max_size);
	public mr_editCreateDelegate mr_editCreate;
	public delegate int mr_editReleaseDelegate(int edit);
	public mr_editReleaseDelegate mr_editRelease;
	public delegate string mr_editGetTextDelegate(int edit);
	public mr_editGetTextDelegate mr_editGetText;

}

// 平台可以调用的函数
public class DSM_EXPORT_FUNCS
{
	public int version;
	public delegate int mr_start_dsmDelegate(ref string filename, ref string ext, ref string entry);
	public mr_start_dsmDelegate mr_start_dsm;
	public delegate int mr_pauseAppDelegate();
	public mr_pauseAppDelegate mr_pauseApp;
	public delegate int mr_resumeAppDelegate();
	public mr_resumeAppDelegate mr_resumeApp;
	public delegate int mr_timerDelegate();
	public mr_timerDelegate mr_timer;
	public delegate int mr_eventDelegate(short type, int param1, int param2);
	public mr_eventDelegate mr_event;
}